public __gc class MetronomeControl //class for handling interactions with metronome mode
{
	public:
		MetronomeControl(System::Windows::Forms::Form * form, System::Windows::Forms::Label * welcomeLabel,
			System::Windows::Forms::Button * goToTuner, System::Windows::Forms::Button * goToMetronome); //contructor
		void hideAll(); //hide components for metronome
		void showAll(); //show components for metronome
		void loadMainMenu(System::Object *  sender, System::EventArgs *  e); //go back to main menu screen

	private:
		//private variables that point to main menu components for reloading
		System::Windows::Forms::Label *  welcomeLabel_;
		System::Windows::Forms::Button *  goToTunerButton_;
		System::Windows::Forms::Button *  goToMetronomeButton_;
		
		//metronome mode components
		System::Windows::Forms::Button *  metBackButton_;
		System::Windows::Forms::Label *  metronomeSettingsLabel_;
		System::Windows::Forms::Label *  tempoLabel_;
		System::Windows::Forms::Button *  fasterButton_;
		System::Windows::Forms::Button *  slowerButton_;
		System::Windows::Forms::Label *  tempoNumberLabel_;
		System::Windows::Forms::GroupBox *  tempoBox_;
		System::Windows::Forms::Button *  startMetronomeButton_;
		
		//thread information for metronome beat
		System::Threading::Thread * thread_;
		__delegate void DelegateThreadTask();
		
		int tempo_; //currently set tempo
		bool shouldRun_; //whether metronome should currently be running
		

		void fastTempo(System::Object *  sender, System::EventArgs *  e); //increase target tempo, on button click
		void slowTempo(System::Object *  sender, System::EventArgs *  e); //decrease target tempo, on button click
		void checkTempoName(); //set label for tempo name if name exists
		void playBeat(); //play the metronome tones
		void startBeat(System::Object *  sender, System::EventArgs *  e); //on button click, create thread for metronome
};